package MethodTest.MethodRecursionTest;
/*
使用递归求1-n的和
 */
public class RecursionTest2 {
    public static void main(String[] args){
        System.out.println(sum(100));
    }
    public static int sum(int n){
        if(n == 1){
            return 1;
        }
        return n + sum(n-1);
    }
}
